#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define XH(i,a,b) for(int i = a; i < b; ++i)
#define XXH(i,b,a) for(int i = b; i >= a; --i)
#define Module 998244353
int tInt;ll tll;string tString;char tChar;
vector<int>tIVector;

int t,n;

void solve(){
  int record[n],visit[n];
  XH(i,0,n)cin>>record[i];
  int cnt = 0;
  vector<int>even,odd;
  XH(i,0,n){
    if(record[i]%2 == 0){
      even.push_back(record[i]);
    }else{
      odd.push_back(record[i]);
    }
  }
  int i;
  for(i = 0; i + 2 < even.size(); i+=2){
    printf("%d %d", even[i], even[i+1]);
    cnt += 2;
    if(cnt != n)printf(" ");
  }
  while(i < even.size()){
    printf("%d",even[i]);
    cnt++;
    if(cnt != n)printf(" ");
    ++i;
  }
  for(i = 0; i + 2 < odd.size(); i+=2){
    printf("%d %d", odd[i], odd[i+1]);
    cnt += 2;
    if(cnt != n)printf(" ");
  }
  while(i < odd.size()){
    printf("%d",odd[i]);
    cnt++;
    if(cnt != n)printf(" ");
    ++i;
  }
  printf("\n");
}

int main(){
  #ifndef ONLINE_JUDGE
    auto start_clock = clock();
    //freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
  #endif
  cin>>t;
  XH(i,0,t){
    cin>>n;
    solve();
  }
  
  #ifndef ONLINE_JUDGE
    auto end_clock = clock();
    //cout<<"runtime: "<<end_clock - start_clock<<"ms"<<endl;
  #endif
  return 0;
}
